package org.gd136.ce.script.impl;

import org.gd136.ce.script.Script;
import org.gd136.ce.script.ScriptStage;

public class IfEndScript extends Script {

	@Override
	public Script readScript(String scriptLine) {
		IfEndScript ies = null;
		if ("#ifEnd".equals(scriptLine)) {
			ies = new IfEndScript();
			if (IfScript.lastIfScript == null) {
				throw new IllegalArgumentException("ifEnd 需要用于if结尾! file["
						+ fileName + "] line[" + lineNum + "]");
			}
			IfScript.lastIfScript.ifEndScript = ies;
			ies.addToPool();
		}
		return ies;
	}

	@Override
	public void execute(ScriptStage stage) {

	}

}
